16. Lab - Deploy App to Beanstalk
# Elastic Beanstalk
In this hands-on exercise, you will use Elastic Beanstalk to deploy a web application to the cloud.
Pre-requisites:
- AWS Account
- DOWNLOAD THIS: WAR file containing the web application code
Topics Covered:
By the end of this lab, you will be able to:
- Deploy a web application to the cloud using Elastic Beanstalk
Steps:
- Access Elastic Beanstalk service from AWS Management Console
- On the AWS Management Console page, type
elastic beanstalk
in theFind Services
box and then selectElastic Beanstalk
. - If this is your first time accessing Elastic Beanstalk, click the
Get started
button. - Enter an
Application name
. - Under
Platform
, click the dropdown forChoose a platform
. SelectTomcat
. - Under
Application code
, selectUpload your code
. Click theUpload
button. - Under
Upload your code
, make sureLocal file
is selected forSource code origin
. - Click
Choose File
and upload the downloaded WAR file (link above in pre-requisites),udacity.war
. - Click the
Upload
button. - Click the
Create application
button.
Important: It will take about 10 minutes for your application to be created. There are several resources that need to be spun up to support your application. Your application is created once you see a green check mark and theHealth
of your application isOk
. - After the application is created, copy the application’s URL.
Important: The URL can be found on the top of the page, to the right of your application’s name.
- On the AWS Management Console page, type
- Test the deployed web application in a browser
- Navigate to a web browser like Chrome or Safari.
- Paste the application URL and append
/message
on the end of the URL. - Upon successfully accessing that URL, you will see the text
Hello World
in your browser window.
- Inspect the EC2 instance created for you
- Navigate to the EC2 console and inspect the instance that was created for you. The instance has the same name as your application. You can administer and manage this EC2 as if you created it yourself.
- Cleanup and delete resources
- To clean up the resources to avoid recurring charges, navigate back to the Elastic Beankstalk console.
- Select your application.
- Select the
Actions
button in the upper-right hand corner. - Select
Terminate environment
. - Enter the name of the application to be deleted.
- Click the
Terminate
button. - After the application is terminated, you will be brought to the main page for the application.
- Click on the
Actions
button in the upper right-hand corner. - Select
Delete application
. - Enter the name of your application.
- Click the
Delete
button.
Deploy Application to Elastic Beanstalk
Task Feedback:
Amazing Work!